package com.uwlaser.service;

import com.uwlaser.base.CommonService;
import com.uwlaser.base.PageInfo;
import com.uwlaser.domain.PlanWorkOrder;
import com.uwlaser.service.dto.PlanWorkOrderDto;
import com.uwlaser.service.dto.PlanWorkOrderQueryParam;
import org.springframework.data.domain.Pageable;

import java.io.IOException;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;

/**
* @author zk-Qin
* @date 2022-05-11
*/
public interface PlanWorkOrderService extends CommonService<PlanWorkOrder>  {

    static final String CACHE_KEY = "planWorkOrder";

    /**
    * 查询数据分页
    * @param query 条件
    * @param pageable 分页参数
    * @return PageInfo<PlanWorkOrderDto>
    */
    PageInfo<PlanWorkOrderDto> queryAll(PlanWorkOrderQueryParam query, Pageable pageable);

    /**
    * 查询所有数据不分页
    * @param query 条件参数
    * @return List<PlanWorkOrderDto>
    */
    List<PlanWorkOrderDto> queryAll(PlanWorkOrderQueryParam query);

    PlanWorkOrder getById(Integer id);
    PlanWorkOrderDto findById(Integer id);

    /**
     * 插入一条新数据。
     */
    int insert(PlanWorkOrderDto resources);
    int updateById(PlanWorkOrderDto resources);
    int removeById(Integer id);
    int removeByIds(Set<Integer> ids);

    /**
     * 获取状态数量
     * @return
     */
    HashMap<String,Integer> getStatusCount();

    /**
     * 获取监控工单列表
     * @param query
     * @param pageable
     * @return
     */
    PageInfo<PlanWorkOrderDto> monitor(PlanWorkOrderQueryParam query, Pageable pageable);

    /**
     * 获取工单不合格信息
     * @param query
     * @return
     */
    List<Map<String,Object>> failInfo(PlanWorkOrderQueryParam query);

    /**
    * 导出数据
    * @param all 待导出的数据
    * @param response /
    * @throws IOException /
    */
    // void download(List<PlanWorkOrderDto> all, HttpServletResponse response) throws IOException;
}
